package com.springboot.service.Images.impl;

import com.springboot.mapper.Images.ImagesMapper;
import com.springboot.pojo.Images;
import com.springboot.service.Images.ImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImagesServiceImpl implements ImagesService {

    private ImagesMapper imagesMapper;

    @Autowired
    public ImagesServiceImpl(ImagesMapper imagesMapper) {
        this.imagesMapper = imagesMapper;
    }

    @Override
    public List<Images> getAllImages() {
        return imagesMapper.getAllImages();
    }

    @Override
    public Images getImageById(Long imageId) {
        return imagesMapper.getImageById(imageId);
    }

    @Override
    public void addImage(Images image) {
        imagesMapper.addImage(image);
    }

    @Override
    public void updateImage(Images image) {
        imagesMapper.updateImage(image);
    }

    @Override
    public void deleteImage(Long imageId) {
        imagesMapper.deleteImage(imageId);
    }
}